Subject: Re: Boopsi, layers and clipping???
From: [email-masked] (Jan van.den.Baard)
Date: 20 Mar 94 16:41:18 GMT
Newsgroups: comp.sys.amiga.programmer

Hello Patrik,
In a message of 19 Mar 94 you wrote about Boopsi, layers and clipping???:

 PL> Hello!

 PL> Here's a delicate problem for someone to solve!

 PL> What's the proper way to do clipping when rendering a boopsi-gadget?

 PL> I've tried the following:

 PL> ...

 PL>     struct GadgetInfo *ginfo = msg->gpr_GInfo;;
 PL>     struct Region *old;

 PL>     LockLayerInfo(ginfo->gi_Layer->LayerInfo);
 PL>     LockLayer(NULL, ginfo->gi_Layer);

 PL>     old = InstallClipRegion(ginfo->gi_Layer, myclipregion);

 PL>     ... Rendering ...

 PL>     InstallClipRegion(ginfo->gi_Layer, old);
 PL>     UnlockLayer(ginfo->gi_Layer);
 PL>     UnlockLayerInfo(ginfo->gi_Layer->LayerInfo);

 Try this.

        struct GadgetInfo *ginfo = msg->gpr_GInfo;
        struct Region *old;
        BOOL update = FALSE;

        if ( ginfo->gi_Layer->Flags & LAYERUPDATING ) {
                EndUpdate( ginfo->gi_Layer, FALSE );
                update = TRUE;
        }

        old = InstallClipRegion(ginfo->gi_Layer, myclipregion);

        ... Rendering ...

        InstallClipRegion(ginfo->gi_Layer, old);

        if ( update )
                BeginUpdate( ginfo->gi_Layer );

Bye,
         // Jaba Development
        //  Fido : 2:285/404.29 (Jan van.den.Baard)
    \\ //   Fido : 2:285/502.7    "   "   "    "
     \X/    EMail: [email-masked]